import Vue from 'vue'
import Router from 'vue-router'
import Layout from '@/view/layout/Layout.vue'
import HomeLayout from '@/view/layout/HomeLayout.vue'
import Login from '@/components/Login.vue'
import LoginByPhone from '@/components/LoginByPhone.vue'



Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      component: Layout,
      redirect:'/Login',
      children:[
        {
          path:'Login',
          name:'Login',
          component:Login,
          meta:{requireAuth:false}//表示不需要登陆就能访问
        },
		{
			path:'LoginByPhone',
			name:'LoginByPhone',
			component:LoginByPhone,
			meta:{requireAuth:false}//表示不需要登陆就能访问
		}	
      ]
    },
    {
      path: '/home',
      component: HomeLayout,
      redirect:'/home/taskList',
      children:[
        {
          path:'taskList',
          name:'taskList',
          component:()=> import('@/view/home/index.vue'),
          meta:{requireAuth:true}
        },
        {
          path:'personal',
          name:'personal',
          component:()=> import('@/view/personal/personal.vue'),
          meta:{requireAuth:true}
        },
        {
          path:'taskManagement',
          name:'taskManagement',
          component:()=> import('@/view/personal/taskManagement.vue'),
          meta:{requireAuth:true}
        }
      ]
    },

  ]
})
